Triggers - Conditions

Sometimes you only want a trigger to function in certain circumstances, for example during the day but not during the night. This can be achieved using the conditions, any of which can be added to a trigger and then the action will only be performed if the condition is true (or false if the "NOT" checkbox is ticked).

You may have multiple identical triggers with different conditions, allowing the same trigger to be used to do different actions - for instance start a timeline if it is not running, but stop the timeline if it is already running. You can also apply multiple conditions to a trigger and each condition must be true (or false if the "NOT" checkbox is ticked) before the action is performed.

Note that conditions do not specify a Controller - they are always tested on the same Controller as the trigger is detected. So if your trigger is a serial input on Controller 2, your digital input condition will look at the digital inputs on Controller 2. In situations where you really need to test conditions on a different Controller there are various tricks that could be used to achieve this, please contact support.

NOTE: Conditions are not tested by the simulator.

Condition types

Timeline running

Use this condition to determine if a timeline is currently running. Running is defined as being between the start and the end of the timeline - so a timeline holding at end is not running. This condition can be useful if you want to only start a timeline if it is not already running. Sometimes timelines are used as timers and this condition is used to determine if the timer has expired.

Timeline onstage

Use this condition to determine if a timeline is currently affecting the output of the Controller. It will be true as long as one fixture patched to this Controller is being controlled by the timeline. It does not matter whether the timeline is running or holding at end.

Real Time

Real time conditions can be used to limit the operation of a trigger to certain times. A single condition can be set to match if the current time is before, after or equal to the time specified. Remember that the advanced dialog can be used to set a mask - this can be particularly useful with the "equal" setting for defining ranges, for example daily opening times. Where you want to specify a very specific range of times you can use two real time conditions on the same trigger, one specifying the time it must be after and the other the time it must be before, and both must match.

The conditions work by creating a mask of times, where each value of a component (year, month, day, day of week, hour, minute or second) can either be in the mask or not. When a trigger that has this condition on it is triggered, the current time will have a single value for each component. If the operator is Equals, the mask must contain those values for the condition to be satisfied:

Choosing "Every day" means all years, months and days are in the mask, so they will all satisfy the condition. Similarly, "Any Time" means all hours, minutes and seconds are in the mask, so any time will satisfy the condition. "Once a week" means only one day of the week is in the mask, so the condition is only satisfied when tested on that day of the week. Choosing a particular date or time means that only that date or time is set in the mask, so no other will satisfy the condition.

Using the Advanced mode, you can create more versatile masks:

For example, for the condition to be satisfied between 10pm and 4am, you would highlight all years, months, days, days of the week, minutes and seconds in the mask, but only set 22, 23, 0, 1, 2 and 3 in the hour mask. Thus, the condition will only be satisfied when the current hour is between 10pm and 4am.

Another example might be if you wanted the condition to be satisfied in every tenth minute on Sundays. Here, you would highlight all years, months, days, hours, and seconds in the mask, highlight only Sunday in the Day Name and highlight 0, 10, 20, 30, 40 and 50 in the minutes.

If the operator is set to Before (or After), the condition is satisfied if the current time is before (or after) the time set in the mask. If the mask contains a unique time (a single value for year, month, day, hour, minute and second), this should be easy to understand.

If the whole mask is set for a component of the date, that component is always satisfied as being Before (or After) the current time.

If the mask contains multiple (but not all) values in a component of the mask, only the first set value is taken. For example, if the day of the week component has Monday and Tuesday set, this is interpreted as being Before or After Monday.

When the operator is Before or After, the day of week is only considered if every value of the day component is set (so it will be satisfied on any day of the month).

NOTE: Conditions are always tested on the Controller that handles the trigger. Real time triggers are always handled on the Controller designated as Time Server. But if you use real time conditions in situations where they will be tested on Controllers that are not the Time Server then it is up to the user to make sure the time and date are set correctly on all the Controllers and not just on the Time Server although they should synchronize automatically.

Astronomical

The Controllers are also equipped with astronomical clock algorithms which automatically generate the correct sunrise, sunset and twilight times for the location of the installation (see project properties).

Astronomical conditions can be used to limit the operation of a trigger to daytime or nighttime by selecting between dawn & dusk, sunrise & sunset, sunset & sunrise, etc. You can also specify offsets, negative or positive, in minutes as required.

There is also the option to select real time instead of sunset, sunrise or twilight and enter a time to create a hybrid condition such as "Between dawn and before 01:00".

Two versions of dawn and dusk are offered, using the two definitions of twilight: civil and nautical. Please see Wikipedia for an explanation of these terms.

Note that, unlike the timeline running condition, its result may vary between different Controllers in a network system because it depends on whether fixtures in the timeline are locally patched.

Lunar

As well as astronomical triggers the Controller uses lunar clock algorithms to calculate the lunar phases based on the location of the Controller (see project properties).

Lunar conditions can be used to limit the operation of a trigger to specified lunar phases by selecting between new moon & full moon, first quarter & third quarter, etc.

Digital input

You can specify a condition based on the current state of an LPC's, TPC with EXT's or Remote Device's digital input. Leave the Device as Local to check an LPC's or TPC with EXT's input, or choose a RIO. Select the input number and whether it is active high or low (select low for contact closure).

Note that if you have more than one RIO of the same type with the same address then the condition will check against the most recent event received.

Digital inputs on Controllers or Remote Devices can also be used to detect contact closures.

Digital word

This condition allows you to test multiple of the digital inputs as a single condition. By clicking repeatedly on the numbers representing each input you can specify whether it has to be low, high or either (the default) to match.

As a side-effect the condition will also capture as a variable the state of all inputs set to match as a binary number. This can be useful if you want to pass a lot of information (such as a timeline number) using a set of digital inputs. When building the binary number low (or contact closed) is treated as a one and high (or contact open) is treated as a zero and input 1 is the least significant bit (LSB) and input 8 is the most significant bit (MSB).

Analog Input

The revised LPC hardware and TPC with EXT have 8 inputs that can be configured as digital or analog inputs in the Interfaces tab of the Network view. The RIO 80 and RIO 44 also have configurable inputs, see Remote Devices.

You can specify a condition based on the current state of an analog input. Set Device to Local to use a Controller's input or choose a RIO. Then select the input number and the percentage range of input voltage. The voltage range of an Controller's or RIO's analog input can be configured in the Network view.

DMX In

This condition will test whether the last received value for a particular DMX channel is within the specified range.

The Port setting is only necessary if using DMX-IN Expansion Modules with the original LPC hardware. In this case you can select between port 1 and 2 (in the order they are connected to the LPC).

Script

Use this to run a Lua script where the returned value determines whether the condition is true or not. Press Launch Editor to open the script editing dialog. If you can not achieve what you want with the conditions provided it is almost certain that a script can be defined to solve your problem.

The Pharos Controllers support a scripting language that can be used for handling complicated conditional triggering or other advanced control requirements. The user can write scripts and set them to run in response to any trigger event. From within a script you can do all the things that you can do with a trigger in the triggers screen – access passed-in variables, test conditions and perform actions - but you can also define more complicated conditional statements and perform mathematical operations.

Designer provides sample scripts which are located in Program Files at \Pharos\Designer\resources\scripts\conditions.

WARNING: Scripts are an advanced feature intended to solve problems that cannot be addressed in any other way. They are not as user-friendly as the normal triggers interface and incorrectly written scripts will not work as intended and could cause other problems with the operation of your Controller. For help with writing scripts, please see the Trigger Script Programming Guide, or please contact support to discuss requirements for a particular project.

BPS Button

You can specify a condition based on the current state of a button. Select the BPS and button number and whether it is pressed (Down) or not (Up).

Remote Device Online  

Use this condition to determine if a Remote Device is online (or offline with "NOT" checked), select the type (RIO or BPS) and its number.

DALI Ballast Error

Use this condition to determine if any or a single ballast(s) have reported a fixture error.

DALI Bus Power

Use this condition to determine the electrical state of a specific DALI bus.

eDMX Pass-Thru Detected

Use this to test if a valid eDMX source is detected on the specified port. See patch for more information.

Related Topics Link IconRelated Topics